package 装饰模式.商场促销实例;


/**
 * @author zyl
 * @Description
 * @since 2023/12/26 10:46
 */

public class CashRebate extends CashSuper {

    private double moneyRebate  = 1d;

    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double price, int num) {
        double v = price * num * this.moneyRebate;
        return super.acceptCash(v,1);
    }
}
